﻿using KillBill.Presentation.Common;
using KillBill.Presentation.Modules.Administration.AdministrationServiceReference;
using KillBill.Presentation.Modules.Administration.IView;

namespace KillBill.Presentation.Modules.Administration.Presenter
{
    public class EmployeeListPresenter
    {
        public IEmployeeList View { get; set; }

        private readonly AdministrationServiceClient _service;

        public EmployeeListPresenter(IEmployeeList view)
        {
            _service = new AdministrationServiceClient();
            View = view;
            View.Employees = _service.GetEmployees(Context.SessionID).Employees;
        }

        public void Find(string value)
        {
            View.Employees = _service.FindEmployees(value, Context.SessionID).Employees;
        }
    }
}
